import okhttp3.*;

import java.io.File;
import java.io.IOException;

public class TecentOCRDemo {

    public static void main(String[] args) throws IOException {
        OkHttpClient client = new OkHttpClient().newBuilder()
                .build();
        MediaType mediaType = MediaType.parse("text/plain");
        RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
                .addFormDataPart("multipartFile","dingdan.jpg",
                        RequestBody.create(MediaType.parse("application/octet-stream"),
                                new File("dingdan.jpg")))
                .build();
        Request request = new Request.Builder()
                .url("")
                .method("POST", body)
                .build();
        Response response = client.newCall(request).execute();
        //get response json text
        String result = response.body().string();
        System.out.println(result);


//        String result = response.message();
//        System.out.println(result);
    }
}
